package com.dev.base.ability;

import com.dev.base.able.IModelLisenner;
import com.dev.base.bean.BaseBean;
import com.dev.base.expand.mvp.BasePresenter;
import ohos.app.Context;

public class MainPresenter extends BasePresenter<MainModel> implements IModelLisenner {
    private MainModel mainModel;

    public MainPresenter(Context mContext) {
        super(mContext);
        mainModel=new MainModel();
        mainModel.init();
        mainModel.setiModelLisenner(this);
        setiModelLisenner(this);

    }

    @Override
    protected MainModel getBasePresenter() {
        return mainModel;
    }


    public void login(){
        showProgressDialog();
        mainModel.login();
    }
    @Override
    public void onHosComplete(int flag) {
    }

    @Override
    public void onHosNext(BaseBean bean) {
        dismiss();
        getiBasegetBasePresenter().getData(bean);
    }

    @Override
    public void onHosError(int flag, Throwable e) {
    }
}
